import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import store from '../store'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    meta:{
      needLogin:false,
      title:'文章列表'
    },
    component: Home
  },
  {
    path: '/register',
    name: 'register',
    meta: {
      needLogin: false,
      title: '用户注册'
    },
    component: () => import('../views/register.vue')
  },
  {
    path: '/about',
    name: 'About',
    meta:{
      needLogin:true,
      title:'发布文章'
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/column',
    name: 'column',
    meta: {
      needLogin: false,
      title: '专题列表'
    },
    component: () => import('../views/column.vue')
  },
  {
    path: '/login',
    name: 'login',
    meta:{
      needLogin:false,
      title:'用户登录'
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/login.vue')
  },
 
]


const router = createRouter({
  history: createWebHashHistory(),
  routes
})



export default router
